{extend name="layouts/iframe" /}

{block name="content"}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">
            <span>新增管理员</span>
        </div>
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="required">*</span>是否启用</label>
                    <div class="layui-input-block">
                        <input type="checkbox" name="status" checked="" lay-skin="switch" lay-text="启用|禁用">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="required">*</span>用户名</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input username" name="name" data-username="" value="" maxlength="12" lay-verify="required" placeholder="请输入" autocomplete="off">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="required">*</span>登录邮箱</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input" name="email" value="" maxlength="60" lay-verify="required" placeholder="请输入" autocomplete="off">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="required">*</span>登录密码</label>
                    <div class="layui-input-block">
                        <input type="password" class="layui-input password" name="password" value="" lay-verify="password" placeholder="请输入密码" autocomplete="off">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="required">*</span>确认密码</label>
                    <div class="layui-input-block">
                        <input type="password" class="layui-input confirm_password" name="confirm_password" value="" lay-verify="confirm_password" placeholder="请输入密码" autocomplete="off">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="required">*</span>角色</label>
                    <div class="layui-input-block">
                        {foreach $adminRoles as $adminRole}
                            <input type="checkbox" class="role_ids" name="role_ids[]" value="{{$adminRole.id}}" lay-skin="primary" title="{{$adminRole.name}}">
                        {/foreach}
                    </div>
                </div>

                <input type="hidden" name="id" value="">

                <div class="layui-form-item layui-layout-admin layui-hide">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button type="button" class="layui-btn layui-btn-primary close-btn">取消</button>
                            <button type="button" class="layui-btn laySave" lay-submit="" lay-filter="laySave">保存 <i class="layui-icon layui-icon-release"></i></button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<input type="hidden" class="check_username_url" value="{{:url(strtolower($model).'/checkLoginName')}}">
<input type="hidden" class="save_url" value="{{:url(strtolower($model).'/addpost')}}">
{/block}

{block name="pagescript"}
<script src="{{:asset('__STATIC__/admin/pages/js/admin.js')}}" type="text/javascript"></script>
{/block}